﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Tanmia.Core;
using FluentNHibernate.Mapping;

namespace Tanmia.NHibernate.Mapping
{
    public class BaseNoteMap<T> : ClassMap<T> where T : BaseNote
    {
        public BaseNoteMap()
        {
            Map(x => x.CreateDate).Not.Nullable().Not.Update();
            Map(x => x.NoteNumber).Nullable().Length(128);
            Map(x => x.Notes).Nullable().Length(2048);

            References(x => x.Repository, "RepositoryID").Not.Nullable();
            References(x => x.User, "UserID").Not.Nullable();
        }
    }
}
